#ifndef _Stack_h
#define _Stack_h

#include "CxxUtils.h"
#include "LangUtils.h"

class DoOpStack
{
public: 
	class ds_pop : public _DoOperator
	{
	protected: 
		ds_pop(const ds_pop &);
		ds_pop& operator=(const ds_pop &);
	public: 
		ds_pop() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_exch : public _DoOperator
	{
	protected: 
		ds_exch(const ds_exch &);
		ds_exch& operator=(const ds_exch &);
	public: 
		ds_exch() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_dup : public _DoOperator
	{
	protected: 
		ds_dup(const ds_dup &);
		ds_dup& operator=(const ds_dup &);
	public: 
		ds_dup() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_copy : public _DoOperator
	{
	protected: 
		ds_copy(const ds_copy &);
		ds_copy& operator=(const ds_copy &);
	public: 
		ds_copy() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
		
		virtual bool match(DevilSemantic &state) const;
	};

	class ds_index : public _DoOperator
	{
	protected: 
		ds_index(const ds_index &);
		ds_index& operator=(const ds_index &);
	public: 
		ds_index() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_roll : public _DoOperator
	{
	protected: 
		ds_roll(const ds_roll &);
		ds_roll& operator=(const ds_roll &);
	public: 
		ds_roll() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_clear : public _DoOperator
	{
	protected: 
		ds_clear(const ds_clear &);
		ds_clear& operator=(const ds_clear &);
	public: 
		ds_clear() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_count : public _DoOperator
	{
	protected: 
		ds_count(const ds_count &);
		ds_count& operator=(const ds_count &);
	public: 
		ds_count() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_mark : public _DoOperator
	{
	protected: 
		ds_mark(const ds_mark &);
		ds_mark& operator=(const ds_mark &);
	public: 
		ds_mark() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_cleartomark : public _DoOperator
	{
	protected: 
		ds_cleartomark(const ds_cleartomark &);
		ds_cleartomark& operator=(const ds_cleartomark &);
	public: 
		ds_cleartomark() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	class ds_counttomark : public _DoOperator
	{
	protected: 
		ds_counttomark(const ds_counttomark &);
		ds_counttomark& operator=(const ds_counttomark &);
	public: 
		ds_counttomark() : _DoOperator() {
		}

		virtual void execute(DevilSemantic &semantic);
	};

	static void push(_DoDictionaryMultimap& dict) {
		dict.put(CRefPtr< _DoObject >(new DoName("pop")), CRefPtr< _DoObject >(new ds_pop()));
		dict.put(CRefPtr< _DoObject >(new DoName("exch")), CRefPtr< _DoObject >(new ds_exch()));
		dict.put(CRefPtr< _DoObject >(new DoName("dup")), CRefPtr< _DoObject >(new ds_dup()));
		dict.put(CRefPtr< _DoObject >(new DoName("copy")), CRefPtr< _DoObject >(new ds_copy()));
		dict.put(CRefPtr< _DoObject >(new DoName("index")), CRefPtr< _DoObject >(new ds_index()));
		dict.put(CRefPtr< _DoObject >(new DoName("roll")), CRefPtr< _DoObject >(new ds_roll()));
		dict.put(CRefPtr< _DoObject >(new DoName("clear")), CRefPtr< _DoObject >(new ds_clear()));
		dict.put(CRefPtr< _DoObject >(new DoName("count")), CRefPtr< _DoObject >(new ds_count()));
		dict.put(CRefPtr< _DoObject >(new DoName("mark")), CRefPtr< _DoObject >(new ds_mark()));
		dict.put(CRefPtr< _DoObject >(new DoName("cleartomark")), CRefPtr< _DoObject >(new ds_cleartomark()));
		dict.put(CRefPtr< _DoObject >(new DoName("counttomark")), CRefPtr< _DoObject >(new ds_counttomark()));
	}
};

#endif
